package com.ilovetolearn.controller
{
	import com.adobe.cairngorm.control.FrontController;
	import com.ilovetolearn.command.InitializeCommand;
	import com.ilovetolearn.command.InitializeWordCommand;
	import com.ilovetolearn.command.SaveWordCommand;
	import com.ilovetolearn.command.StudyWordCommand;
	import com.ilovetolearn.event.InitializeEvent;
	import com.ilovetolearn.event.InitializeWordEvent;
	import com.ilovetolearn.event.SaveWordEvent;
	import com.ilovetolearn.event.StudyWordEvent;

	public class Controller extends FrontController
	{
		public function Controller()
		{
			super();
			initialize();
		}

		private function initialize():void
		{
			//初始化用户信息和课程信息
			this.addCommand(InitializeEvent.INITIALIZE_EVENT, InitializeCommand, true);
			//初始化词汇信息
			this.addCommand(InitializeWordEvent.INITIALIZEWORD__EVENT, InitializeWordCommand, true);
			//开始词汇学习
			this.addCommand(StudyWordEvent.STUDYWORD_EVENT, StudyWordCommand, true);
			//保存学习结果
			this.addCommand(SaveWordEvent.SAVEWORD_EVENT,SaveWordCommand,true);
		}
	}
}